package routers

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"go-0650-blog-grom/controller"
)

/**
 * @Author sswang
 * @Description //TODO 用户路由
 * @Date 14:33 2022/12/12
 **/

func UserRoutersInit(r *gin.Engine) {
	userRouters := r.Group("/user")
	{
		userRouters.GET("/test", func(c *gin.Context) {
			fmt.Println("访问到: /test")
			c.String(200, "用户模块测试请求！")
		})

		userRouters.GET("/test_f", controller.UserController{}.TestF)

		// 用户注册
		userRouters.GET("/sign", controller.UserController{}.SignUp)

		// 用户登录
		userRouters.GET("/login", controller.UserController{}.Login)

		// 刷新 Token
		userRouters.GET("/refresh_token", controller.UserController{}.RefreshToken)
	}
}
